#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int main()
{
    long long n = 0;
    scanf("%ld", &n);

    int i = 0, k = 0, flag = 0;
    if (n >= 0)
        flag = 1;
    else
    {
        flag = 0;
        n = abs(n);
    }
        

    while (n != 0)
    {
        k = n % 2;
        if (k == 1)
            i++;
        n /= 2;
    }

    
    if (flag == 1)
        //return i;
        printf("%d", i);
    else
        printf("%d", 33-i);
        //return 33 - i;
	return 0;
}